package edu.java.texbooks.scjp.threads.test08;

public class MyJob implements Runnable {

//	@Override
//	public synchronized void run() {
//		System.out.println(Thread.currentThread().getName()
//				+ ": do something in run() method of MyJob object");
//
//		try {
//			wait();
//		} catch (InterruptedException ie) {
//			System.out.println(Thread.currentThread().getName()
//					+ " is interrupted.");
//		}
//
//	}

	 @Override
	public void run() {
		System.out.println(Thread.currentThread().getName()
				+ ": do something in run() method of MyJob object");

		synchronized (this) {
			try {
				wait();
			} catch (InterruptedException ie) {
				System.out.println(Thread.currentThread().getName()
						+ " is interrupted.");
			}
		}
	
	 }

}
